﻿<%@ Page Title="" Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="App_Default" %>


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Glouk under development</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=940, user-scalable=yes" />
    <link rel="shortcut icon" type="image/png" href="/style/img/favicon.png" />
    <link rel="icon" type="image/png" href="/style/img/favicon.png" />
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600,600italic,700,700italic,800,800italic&subset=latin,latin-ext' rel='stylesheet' type='text/css' />
    <link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet" type='text/css' />

    <link href="/Style/App/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="/Style/App/css/bootstrap-responsive.css" rel="stylesheet" />
    <link href="/Style/App/css/layout.css" rel="stylesheet" media="screen" />
    <link href="/Style/App/css/tooltipster.css" rel="stylesheet" type="text/css" />
    <link href="/js/jquery/css/msdropdown/dd.css" rel="stylesheet" type="text/css" />
    <link href="/js/jquery/css/chosen/chosen.css" rel="stylesheet" type="text/css" />


</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager runat="server" ID="ScmMain">
            <Scripts>
                <asp:ScriptReference Path="http://code.jquery.com/jquery-1.9.1.js" />
                <asp:ScriptReference Path="http://code.jquery.com/ui/1.10.3/jquery-ui.js" />

                <asp:ScriptReference Path="~/js/jquery/js/jquery.blockUI.js" />
                <asp:ScriptReference Path="~/js/jquery/js/jquery.oauthpopup.js" />
                <asp:ScriptReference Path="~/js/jquery/js/jquery.dd.js" />
                <asp:ScriptReference Path="~/js/jquery/js/jquery.maskedinput.js" />
                <asp:ScriptReference Path="~/js/jquery/js/chosen.jquery.js" />
                <asp:ScriptReference Path="~/js/jquery/js/jquery.tooltipster.js" />

                <asp:ScriptReference Path="~/js/Ajax.js" />
                <asp:ScriptReference Path="~/js/Lib.js" />

                <asp:ScriptReference Path="~/js/App/waypoints.min.js" />
                <asp:ScriptReference Path="~/js/App/script.js" />


            </Scripts>

        </asp:ScriptManager>

        <asp:UpdatePanel ID="UpPTimer" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <div id="content_UpPTimer">
                </div>
                <asp:Timer runat="server" ID="TimerUpdate" Interval="60000" Enabled="true">
                </asp:Timer>
            </ContentTemplate>
        </asp:UpdatePanel>


        <div class="navbar first ">
            <div class="navbar-inner">
                <a class="brand" href="/" title="Glouk"></a>
                <span class="slogan">Get the best out of Twitter!</span>
                <asp:UpdatePanel ID="UpPAlertCount" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div id="content_UpPAlertCount">
                        </div>
                        <%--                        <asp:Timer runat="server" ID="ttt" Interval="2000" Enabled="true">
                        </asp:Timer>--%>
                        <asp:Button runat="server" ID="BtnViewAlert" CssClass="notify yes-notify" Text="" />
                    </ContentTemplate>
                </asp:UpdatePanel>
                <a href="#" class="user male pull-right">
                    <% = Me.CurrUser.Name%><br />
                    <% = Me.CurrUser.Surname  %>
                </a>
            </div>
        </div>

        <div class="navbar scroll hide navbar-fixed-top">
            <asp:UpdatePanel ID="UpPBarScroll" runat="server" UpdateMode="Conditional" class="navbar-inner">
                <ContentTemplate>
                    <a class="dashboard link_to" href="#DASHBOARD" title="Dashboard">Dashboard</a>
                    <div class="report-social">
                        <p>@<% = Me.CurrAccount.Username%>, <% = Me.CurrAccount.Fullname%> </p>
                    </div>
                    <a href="#" class="user male pull-right"><% = Me.CurrUser.Name%><br />
                        <% = Me.CurrUser.Surname  %>
                    </a>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>

        <div class="navbar second">
            <div class="navbar-inner">
                <a class="dashboard link_to" href="#DASHBOARD" title="Dashboard">Dashboard</a>
                <asp:Panel runat="server" ID="PnlAccount" class="report-social">
                    <asp:DropDownList ID="DdlAccount" runat="server" AutoPostBack="false" Style="margin-bottom: 10px;">
                    </asp:DropDownList>
                    <asp:CheckBox runat="server" ID="ChkGroupEnabled" AutoPostBack="true" Visible="false" />
                    <asp:UpdatePanel ID="UpPAccount" runat="server" UpdateMode="Conditional" class="navbar second">
                        <ContentTemplate>
                            <asp:Button ID="BtnReload_Account" runat="server" Style="display: none;" Text="Reload" />
                            <asp:Panel runat="server" ID="PnlGroup" Visible="false">
                                <asp:ListBox SelectionMode="Multiple" multiple="" ID="DdlAccount2" runat="server" AutoPostBack="false" Style="width: 200px;"></asp:ListBox>
                                <asp:Button ID="BtnMultiAcc" runat="server" Style="display: ;" Text="Reload" />
                            </asp:Panel>
                            <table class="sel-ut">
                                <tr>
                                    <td>
                                        <div class="sel-num"><% = UI.Print.Num0(Me.CurrAccount.Account_Add_Info.Post_Count)%></div>
                                        <div class="sel-txt">TWEET</div>
                                    </td>
                                    <td>
                                        <div class="sel-num"><% = UI.Print.Num0(Me.CurrAccount.Account_Add_Info.Friend_Count)%></div>
                                        <div class="sel-txt">FOLLOWING</div>
                                    </td>
                                    <td>
                                        <div class="sel-num"><% = UI.Print.Num0(Me.CurrAccount.Account_Add_Info.Follower_Count)%></div>
                                        <div class="sel-txt">FOLLOWER</div>
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="ChkGroupEnabled" EventName="CheckedChanged" />
                        </Triggers>
                    </asp:UpdatePanel>
                </asp:Panel>
            </div>

        </div>

        <asp:Panel runat="server" ID="PnlUserMessage" CssClass="avvisi" Visible="false">
            <div class="cont-avvisi">
                <asp:UpdatePanel ID="UpdUserMessage" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div id="content_UpdUserMessage">
                            <asp:LinkButton runat="server" ID="LnkUserMessage" CssClass="avvisi-h"></asp:LinkButton>
                        </div>

                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        </asp:Panel>


        <div class="acontainer" id="main_container">
            <iframe draggable="false" id="contentFrame" name="contentFrame" runat="server" style="border: 0; width: 100%; overflow: hidden; overflow-y: hidden;" scrolling="no"></iframe>


            <div runat="server" id="HTML_MeunAdmin" class="last closed">
                <a href="#">ADMIN TOOL</a>
                <ul>
                    <li><a href='<% = Me.ResolveUrl("~/tools/update.aspx?a=5&o=ok")%>'>--- UPDATE POST</a></li>
                    <li><a href='<% = Me.ResolveUrl("~/tools/update.aspx?a=1&o=ok")%>'>--- UPDATE ACCOUNT</a></li>
                    <li><a href='<% = Me.ResolveUrl("~/tools/update.aspx?a=2&o=ok")%>'>--- UPDATE QUERY</a></li>
                    <li><a href='<% = Me.ResolveUrl("~/tools/update.aspx?a=3&o=ok")%>'>--- SEND POST</a></li>
                    <li><a href='<% = Me.ResolveUrl("~/tools/update.aspx?a=6&o=ok")%>'>--- AUTO FOLLOW</a></li>
                    <li><a href='<% = Me.ResolveUrl("~/tools/update.aspx?a=4&o=ok")%>'>--- ELABORATE DATA</a></li>
                    <li><a href='<% = Me.ResolveUrl("~/tools/update.aspx?a=7&o=ok") %>'>--- REAL-TIME</a></li>
                    <li><a href='<% = Me.ResolveUrl("~/tools/changedb.aspx") %>'>DBASE</a></li>
                    <li><a href='<% = Me.ResolveUrl("~/tools/similtext.aspx") %>'>SIMILT TEXT</a></li>
                </ul>
            </div>


        </div>
        <!--  end container   -->


        <div class="dashboard-hover">
            <div id="icona-dash">
                <ul class="menu">
                    <li class="first">
                        <a class="icon-dashboard alink_to" href="#DASHBOARD" title="Dashboar">Dashboard</a>
                    </li>
                    <li class="second">
                        <a class="icon icon-seo alink_to" href="#SOCIAL_SEO">Social SEO</a>
                    </li>
                    <li class="third">
                        <a class="icon icon-schedule link_to" href="#SCHEDULE">Schedule</a>
                    </li>
                    <li class="">
                        <a class="icon icon-listen link_to" href="#LISTEN">Listen</a>
                        <%--                    <ul class="menu">
                        <li><a class=" link_to" href="#CONVERSATIONS">Conversations</a></li>
                    </ul>--%>
                    </li>
                    <li class="fourth ccollapsed">
                        <span class="icon icon-twitter ">Follow</span>
                        <ul class="menu">
                            <li><a class=" link_to" href="#FOLLOW">follow edit</a></li>
                            <%--<li><a class=" link_to" href="#FOLLOW_LIST">follow list</a></li>--%>
                            <li><a class=" link_to" href="#FOLLOW_STAT">follow stat</a></li>
                            <li><a class=" link_to" href="#HASHTAGS_MONITOR">hashtags monitor</a></li>
                            <%--                        <li><a class=" link_to" href="#FollowersOverview">Categorize</a></li>--%>
                        </ul>
                    </li>
                    <li class="fourth ccollapsed">
                        <span class="icon icon-twitter ">Twitter CRM</span>
                        <ul class="menu">
                            <li><a class=" link_to" href="#CONNECTIONS">Connections</a></li>
                            <li><a class=" link_to" href="#CATEGORIZE">Categorization</a></li>
                            <%--                        <li><a class=" link_to" href="#FollowersOverview">Categorize</a></li>--%>
                        </ul>
                    </li>
                </ul>

            </div>
        </div>


        <div id="notification" class="hide">
            <asp:UpdatePanel ID="UpPAlert" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <div id="content_UpPAlert">
                        <div class="see-all">
                            <asp:LinkButton ID="BtnAlertRead" runat="server" class="notifica-r" Text="segna come già letto" />

                        </div>
                        <asp:ListView ID="ListMessage" runat="server">
                            <ItemTemplate>
                                <asp:LinkButton runat="server" class="notifica-r" CommandArgument='<%# Eval("account_id")%>' CommandName='LISTEN'>
                                <div class="notifica-div">
                                    <div class="social-line">
                                        <img src="<%# eval("avatar") %>" style="width:35px;" />
                                    </div>
                                    <div>
                                        <div class="user">
                                            <div class="<%# IIf(Eval("alert_type_id") = mDB.Alert.Type.MESSAGE, "user-menz","user-mess")%>">
                                                @<%# Eval("from_username")%>
                                            </div>
                                            <%# mDB.Alert.AlertMessage(Eval("alert_type_id"))%>
                                        </div>
                                        <div class="post-time"><%# MyUI.Print.TimeNow2(Eval("alert_date").value)%> ago</div>
                                    </div>
                                </div>
                                </asp:LinkButton>
                            </ItemTemplate>
                        </asp:ListView>
                        <asp:HyperLink runat="server" class="notifica-r" NavigateUrl="#">
                        <div class="see-all">see all</div>
                        </asp:HyperLink>
                    </div>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="BtnViewAlert" EventName="click" />
                </Triggers>
            </asp:UpdatePanel>

        </div>



        <div id="user-menu" class="hide">
            <ul>
                <li><a href="#">Glouk account</a></li>
                <li><a class=" link_to" href="#USERACCOUNTS" title="Dashboar">Social accounts</a> </li>
                <li><a href="#">Options</a></li>
                <li><a class=" link_to" href="#BILLING">Billing</a></li>
                <li>
                    <asp:LinkButton runat="server" ID="BtnLogout">Logout</asp:LinkButton>
                </li>
            </ul>
        </div>

    </form>

    <script type="text/javascript">


        $(function () {

            $(window).on('hashchange', function (e) {

                if (window.location.hash != '') {
                    set_content_frame(window.location.hash);
                }

            });

            resize_layout_page();

            SetUI();
            on_update_panel_server(function () {
                SetUI();
            });

            if (window.location.hash != '') {
                set_content_frame(window.location.hash);
            } else {
                window.location.hash = '#DASHBOARD';
            }

            $(".link_to").click(function () {
                route = $(this).attr("href");
                if (route != '#') {
                    window.location.hash = route;
                    return false;
                }
            });



        });


        function SetUI() {



            $("#BtnMultiAcc").click(function () {
                on_update_panel_server_once(function () {
                    reload_frame();
                });
            });

            $("#ChkGroupEnabled").click(function () {
                on_update_panel_server_once(function () {
                    reload_frame();
                });
            });

            $("#DdlAccount").msDropDown({
                rowHeight: 35, useSprite: false, showIcon: true, enableCheckbox: false,
                on: {
                    change: function () {
                        __doPostBack('BtnReload_Account', '');
                        on_update_panel_server_once(function () {
                            reload_frame();
                        });

                    }
                }
            });

            $("#DdlAccount2").chosen();

            $('.notify').click(function () {
                $('#notification').toggle();
            });

            $('#BtnAlertRead').click(function () {
                $('#notification').toggle();
            });


            //$("#alert").toggle(function () {
            //    $('#alert_list').fadeIn();
            //}, function () {
            //    $('#alert_list').fadeOut();
            //});

        }
        function set_height_frame(h) {
            $('#contentFrame').height(h);
        }

        function reload_frame() {
            $('#contentFrame')[0].contentWindow.location.reload();
        }

        function refresh_frame_data() {
            $('#contentFrame')[0].contentWindow.RefreshData();
        }

        function RefreshData() {
            alert('tt');
            //__doPostBack('BtnReload_UpPConsole', '');
            $('#BtnReload_Account').click();
        }

        function set_content_frame(hash) {

            link_old = $("#contentFrame").attr('src');
            //link_new = links[hash.replace('#', '')] + hash;
            link_new = hash.replace('#', '');
            //alert(link_old + " - " + link_new);
            if (link_new != link_old) {
                open_ajax_wait(null);

                //$("#contentFrame").attr('src', link_new);
                //$('#contentFrame')[0].contentWindow.location.assign(link_new);
                $('#contentFrame')[0].contentWindow.location.replace(link_new);

                //location.replace(location.pathname + hash);
                //location.assign(location.pathname + hash);
                //contentFrame.contentWindow.location.href = location.pathname + hash;
                //$(location).attr('href', location.pathname + hash);
            }
            //$('body').scrollTop(0);

            //location.replace(location.pathname + hash);

        }

        function resize_layout_page() {

            w_scroll = -5; //  12;
            y_scroll = -0; //  12;
            yw = $(window).height() + y_scroll;
            ww = $(window).width() + w_scroll;


            $('#contentFrame').height(yw - 150);

        }
    </script>

</body>
</html>
